#include <cstdio>
#include <cstdlib>
using namespace std;

int main()
{
    int num, *list;
    while (scanf(" %d", &num) != EOF) {
        list = (int*)malloc(sizeof(int) * num);
        for (int i = 0; i < num; i++) 
            scanf(" %d", &list[i]);
        
        int target_count;
        scanf(" %d", &target_count);
        for (int i = 0; i < target_count; i++) {
            int target;
            bool found = false;
            scanf(" %d", &target);
            for (int j = 0; j < num; j++) {
                if (list[j] == target) {
                    found = true;
                    printf("YES\n");
                    break;
                }
            }
            if (!found) 
                printf("NO\n");
        }
        free(list);
    }

    return 0;
}